import { createSlice } from '@reduxjs/toolkit'

const initialState = {
    childrenRoutes: [],
    isSet: true
}

export const routerSlice = createSlice({
    name: 'routerSlice',
    initialState,
    reducers: {
        setChildrenRoutes: (state, action) => {
            state.childrenRoutes = action.payload
            state.isSet = false
        }
    }
})

export const { setChildrenRoutes } = routerSlice.actions
export default routerSlice.reducer